/*
 * This file is part of aion-engine <aion-engine.com>
 *
 * aion-engine is private software: you can redistribute it and or modify
 * it under the terms of the GNU Lesser Public License as published by
 * the Private Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * aion-engine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser Public License for more details.
 *
 * You should have received a copy of the GNU Lesser Public License
 * along with aion-engine.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.aionengine.gameserver.model.templates.challenge;

import com.aionengine.gameserver.model.Race;

import javax.xml.bind.annotation.*;
import java.util.List;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ChallengeTask", propOrder = {"quest", "contrib", "reward"})
public class ChallengeTaskTemplate {

    @XmlElement(required = true)
    protected List<ChallengeQuestTemplate> quest;
    protected List<ContributionReward> contrib;

    @XmlElement(required = true)
    protected ChallengeReward reward;

    @XmlAttribute
    protected Boolean repeat;

    @XmlAttribute(name = "town_residence")
    protected Boolean townResidence;

    @XmlAttribute(name = "name_id")
    protected Integer nameId;

    @XmlAttribute(name = "max_level", required = true)
    protected int maxLevel;

    @XmlAttribute(name = "min_level", required = true)
    protected int minLevel;

    @XmlAttribute(name = "prev_task")
    protected Integer prevTask;

    @XmlAttribute(required = true)
    protected Race race;

    @XmlAttribute(required = true)
    protected ChallengeType type;

    @XmlAttribute(required = true)
    protected int id;

    public List<ChallengeQuestTemplate> getQuests() {
        return this.quest;
    }

    public List<ContributionReward> getContrib() {
        return this.contrib;
    }

    public ChallengeReward getReward() {
        return this.reward;
    }

    public boolean isRepeatable() {
        return this.repeat != null && this.repeat == true;
    }

    public boolean isTownResidence() {
        return this.townResidence != null && this.townResidence == true;
    }

    public Integer getNameId() {
        return this.nameId;
    }

    public int getMaxLevel() {
        return this.maxLevel;
    }

    public int getMinLevel() {
        return this.minLevel;
    }

    public Integer getPrevTask() {
        return this.prevTask;
    }

    public Race getRace() {
        return this.race;
    }

    public ChallengeType getType() {
        return this.type;
    }

    public int getId() {
        return this.id;
    }
}
